package website.lhc.chapter4;

import java.util.Objects;

/**
 * @author: longhc@citycloud.com.cn
 * @since: 2022/12/8 16:35
 * @version: 1.0
 */
public abstract class Decorator implements Component {

    private Component component;

    public void setComponent(Component component) {
        this.component = component;
    }

    @Override
    public void operation() {
        if (Objects.nonNull(component)) {
            component.operation();
        }
    }
}
